<template>
<div class="main">
<div>{{all_myrest_PastPublish==null?'':''}}</div>
    <div class="item" v-for="item in itemList">
        <div class="title">期号:<span class="qihao">{{item.productPeriod}}</span> 揭晓时间:{{item.announcedTime}}</div>
        <div class="cnt">
            <div class="cntintro">
                <div class="userName">获得者:<span class="uname">{{item.userName}}</span></div>
                <div class="userID">用户ID:<span class="uid">{{item.userId}}</span>(唯一不变标识)</div>
                <div class="luckyNum">幸运号码:<span class="luckyval">{{item.randomNumber}}</span></div>
                <div class="canyu">本期参与:<span class="canyuval">{{item.buyNumberCount}}</span>人次</div>
            </div>
        </div>
    </div>
</div>
</template>
<script>
  import stores from './mystore.js'
  import Vue from 'vue';
  import { XButton, XInput,Group, Tab, TabItem } from 'vux'
  import { mapGetters,mapActions } from 'vuex'
  import sha1 from 'js-sha1'

  export default {
      data(){
          return {
              itemList:[],
              mypayload:{
              },
              buypayload:{
              },

              QueryUserPayload:{
                  url:'baseapi',
                  actionName:"QueryUserInfo",
                  postData: {
                      //mobile:"18616717008",
                      //password:"112233",
                      //treeView:"true"
                }
              },
              WangQiPayload:{
                  url:'duodata',
                  actionName:"PastPublish",
                  postData: {
                    productId:"",
                    //mobile:"18616717008",
                    //password:"112233",
                    //treeView:"true"
                  }
              },

          }
      },

      computed:{
          all_myrest_QueryUserInfo(){
              var dataval=this.$store.getters.all_restful_QueryUserInfo;
              if(dataval){
                  return dataval
              }else{
                  return null
              }
              //return dataval;
          },
          all_myrest_PastPublish(){
              var dataval=this.$store.getters.all_restful_PastPublish;
              if(dataval){
                this.itemList=dataval.body.pastPublishList;
                return dataval.body.pastPublishList
              }else{
                return null
              }
              //return dataval;
          },
          all_myrest(){
              return this.$store.getters.all_logindata
          },

      },
      created (){
         // this.cntReady();
        this.wangqi();
          //console.log('hahahahhahahahah'+this.cntReady())
      },

      methods:{
          doesh (){
            this.$store.commit('restful_api',this.QueryUserPayload)
          },
          GetQueryString:function(name){
              var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
              var r = document.URL.split("?")[1].match(reg);
              //alert("ddd:"+window.location.search)
              if(r!=null)return  unescape(r[2]); return null;
          },
          wangqi:function(){
            var pid=this.$route.params.pid;
            this.WangQiPayload.postData.productId=pid;
            this.$store.commit('restful_api',this.WangQiPayload)
          },
        /*  cntReady(){
              console.info(3434343);
              this.$store.commit('restful_api',this.mypayload);
           },
          ...mapActions([
              'increment',
              'decrement',
              'incrementIfOdd'
          ]),
        */
      },
      components: { XButton, Group, XInput, Tab, TabItem }

  }

</script>

<style scoped>
    *{ margin:0; padding:0;}
    html{ background-color:#fbfbfb;}
    body,html,main{ width:100%; font-size:12px;}
    div img{ width:100%;}

    .main{ padding: 10px; box-sizing: border-box;}
    .item{ box-sizing:border-box; -webkit-box-sizing:border-box; border:1px solid #d5d5d5; margin-top:8px;}
    .title{ color:#525252; padding:10px; background-color:#e7e7e7; font-size: 12px;}
    .title span{ margin-right:10px;}
    .cnt{ color:#666; box-sizing:border-box; -webkit-box-sizing:border-box; display:box; display:-webkit-box; padding:10px;}
    /*.headpic{ width:50px; height:50px; background:url(../images/jieheadpic.png) no-repeat; background-size:100% 100%;}*/
    .cntintro{ -webkit-box-flex:1; box-flex:1; padding-left:10px;}
    .userName,.userID,.luckyNum,.canyu{ font-size: 12px;}
    .uname{ color:#0079fe; font-size: 12px; }
    .userIP{ color:#528d00;}
    .luckyval{ color:#db3652;}
    .canyuval{ color:#db3652;}
</style>
